widget: Change GtkCapturePhase behavior in event controllers' handling
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 27 May 2014 10:14:52 +0000 (12:14 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 27 May 2014 15:47:12 +0000 (17:47 +0200)
commit505efbb3f3ae76ffdd4f7e9871cedd84c41cb673
treeab5d2b02553b18a763fc787a3b24af3ceb9c77e4
parenta8e833dc5ce32b46dd4d109aaaaf8f6c2837248f
widget: Change GtkCapturePhase behavior in event controllers' handling

Previously, there would be globally just a capture and a bubble phase,
with the event just going down the hierarchy once, and the up once.
GTK_PHASE_TARGET actually meaning "run within event handlers", so in
a hierarchy of 3 widgets, emission would be:

  Capture(C)
  Capture(B)
  Capture(A)
  Target(A) (if event handlers allow)
  Bubble(A)
  Target(B) (if event handlers allow)
  Bubble(B)
  Target(C) (if event handlers allow)
  Bubble(C)

This commit changes this behavior and uses GTK_PHASE_TARGET in a less
misleading way, running only on the widget that was meant to receive
the event. And GTK_PHASE_BUBBLE has taken over the execution place of
GTK_PHASE_TARGET, so the emission remains:

  Capture(C)
  Capture(B)
  Capture(A)
  Target(A)
  Bubble(A) (if event handlers allow)
  Bubble(B) (...)
  Bubble(C) (...)

As it was, GTK_PHASE_BUBBLE was useful for running event controllers
paralelly to event handlers, without modifying a single line in those.
For those mixed scenarios, Any of the other phases will have to be
used at discretion, or the event handlers eventually changed to chain
up and let the default event handlers in GtkWidget to be run.
gtk/gtkwidget.c